<?php
## include required files
/*******************************/ 
require_once '../../includefiles.php';
include_once("../../model/state.php");
/*******************************/
## Create Objects
/*******************************/
$stateObj = new Model_State();

if ($_GET['statename']){
	$statename = $_GET['statename']; 
}
if ($_GET['id']){
	$id = $_GET['id'];
}

if($statename){
// this function check username exit or not
	 $result = $stateObj->checkStateName(strtoupper(trim($statename)), $id); 
	if(count($result) > 0){	
		if(strtoupper(trim($result['state_name'])) == strtoupper(trim($statename))){  
			echo 'false';
		}
	}
	else{
		echo "true";	
	}
}
unset($stateObj);
?>


